<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <title>后台管理系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <script type="text/javascript" src="assets/js/jquery.min.js"></script>

   <!--  <link rel="stylesheet" href="assets/css/style.css"> -->
    <link rel="stylesheet" href="assets/css/loader-style.css">
    <link rel="stylesheet" href="assets/css/bootstrap.css">
    <link rel="stylesheet" href="assets/css/signin.css">






    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
        <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
    <!-- Fav and touch icons -->
    <link rel="shortcut icon" href="assets/ico/minus.png">
</head>

<body>
    <!-- Preloader -->
    <div id="preloader">
        <div id="status">&nbsp;</div>
    </div>
    <div style="margin-top: 30px" class="container">



        <div class="" id="login-wrapper">
            <div class="row">
                <div class="col-md-4 col-md-offset-4">
                    <div id="logo-login">
                        <h1>后台管理系统
                            <span>v1.1</span>
                        </h1>
                    </div>
                </div>

            </div>

            <div class="row">
                <div class="col-md-4 col-md-offset-4">
                    <div class="account-box">

                        <form role="form" onsubmit="return false">
                            <div class="form-group">
                                <label for="inputUsername">用户名</label>
                                <input type="text" id="inputUsername" class="form-control" placeholder="请输入用户名">
                            </div>
                            <div class="form-group">
                                <label for="inputPassword">密码</label>
                                <input type="password" id="inputPassword" class="form-control" placeholder="请输入密码">
                            </div>
                            <div class="checkbox pull-left">
                                <label><input type="checkbox">记住用户</label>

                            </div>
                        </form>
                        <a class="forgotLnk" href="index1.html"></a>


                        <div class="row-block">
                            <div class="row">
                                <div class="col-md-12 row-block">
                                    <a href="javascript:;" id="login" class="btn btn-primary btn-block">登 录</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>





        <div style="text-align:center;margin:0 auto;">
            <h6 style="color:#fff;">Release Candidate 1.0 Powered by © TianFu 2017</h6>
        </div>

    </div>
    <div id="test1" class="gmap3"></div>



    <!--  END OF PAPER WRAP -->




    <!-- MAIN EFFECT -->
    <script type="text/javascript" src="assets/js/preloader.js"></script>
    <script type="text/javascript" src="assets/js/bootstrap.js"></script>
    <script type="text/javascript" src="assets/js/app.js"></script>
    <script type="text/javascript" src="assets/js/load.js"></script>
    <script type="text/javascript" src="assets/js/main.js"></script>
    <script type="text/javascript" src="./js/common.js"></script>

    <script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=cd93179db2c157b1553a10c5057843d2"></script>
    <!--引入UI组件库（1.0版本） -->
    <script src="//webapi.amap.com/ui/1.0/main.js"></script>
    <script type="text/javascript">

        var map = new AMap.Map('test1',{
            resizeEnable: true,
            zoom: 10,
            center: [121.468524,31.22055]
        });

        map.setFeatures(['road','point']);//多个种类要素显示
    </script>
    <script>
        /*客户端:
                用户填写用户名 uname, 密码pwd , 点击登录按钮
        ajax提交数据到服务器

        服务器:
                接受 用户名 uname, 密码 pwd
        根据用户名和密码 查询数据库
        SELECT id FROM t_user WHERE uname=$uname AND pwd=$pwd
        如果能查询到结果,
                用户存在, 可以登录
                存储rank
        返回结果 {result:'ok'}
        如果没有结果
        用户不存在,
                返回结果 {result:'no'}
        同时客户端提示用户 用户名或密码错误
*/
        $(function(){
            $("#login").click(function(){
                var user = $("#inputUsername").val();
                var password = $("#inputPassword").val();
                var dataBody = {'user':user,'password':password};
                ajaxRequest(IP+"pm/api/index.php?s=/home/index/index", dataBody, login);
            });
            function login(result){
                //会话缓存姓名
                sessionStorage.setItem("rank",result.data.rank);
                sessionStorage.setItem("code",result.data.code);
                sessionStorage.setItem("uname",$("#inputUsername").val());
                location.href = 'index.html';
            }
        })


    </script>


</body>

</html>
